To use - select & highlight a SLOW FADE (video dissolve) icon that is inbetween two VIDEO clips. < OR > select the second of two adjoining VIDEO clips. Then run this ARexx routine. You can control audio fade time & the volume of the second clip. The audio tracks will overlap and fade at the same speed. */
call remlib('PROJECT_REXX_PORT')
call addlib('PROJECT_REXX_PORT',0)
start_loc=croutonspot()
project_end=CroutonsinProject()
f_fadetime=60
/* --------------- see if we're on an ALGO effect & get length of fade */
call croutonpick(start_loc)
FadeOK=0
If croutontype()~="CLIP" then FadeOK=1
if croutontype()="ALGO" then do
test=croutonname()
test1=right(test,length(test)-lastpos("/",test))
test2=("SMOOTH FADE" = upper(test1))
if test2~=0 then do
f_numfields=croutongettag(numfields)
f_fadetime=f_numfields%2
end
end
/* --- test that the 2 (surrounding) clips are VIDEO clips */
videois=0
if start_loc>0 then do
current_spot=start_loc-1
call croutonpick(current_spot)
if croutontype()="CLIP" then do
AudOnP=croutongettag(AUDIOON) /* is there audio on */
if AudOnP>6 then do
videois=1
vol1P=croutongettag(AUDIOVOLUME1)
vol2P=croutongettag(AUDIOVOLUME2)
end
end
end
if start_loc<project_end then do
current_spot=start_loc+FadeOK
call croutonpick(current_spot)
if croutontype()="CLIP" then do
AudOnN=croutongettag(AUDIOON) /* is there audio on */
if AudOnN>6 then do
videois=(videois+1)
vol1N=croutongettag(AUDIOVOLUME1)
vol2N=croutongettag(AUDIOVOLUME2)
end
end
end
call croutonpick(start_loc)
/* --- wait for any screen update delay --- */
call time('R')
do while (time('E')<0.5)
end
call req_open("<< Crossfade - by Aussie >>","--------------------------------"," Select SECOND of 2 adjoining VIDEO clips, or the EFFECT between 2 video clips, "," then run this routine. It will crossfade audios at same speed. ")
/* --- weed out errors */
if (AudOnP<7) | (AudOnN<7) then do
call req_tell("<< Canceled >>"," A VIDEO clip has audio turned OFF!")
call quit2()
end
if videois~=2 then do
test=req_tell("Sorry... canceled"," Selected 2nd of 2 VIDEO clips,","or the EFFECT between 2 VIDEO clips.")
call quit2()
end
/* --- Calculate Volumes --- */
highvol=0
vol1=((vol1N/655.35)+0.5)%1
if vol1<0 then vol1=0
if vol1>100 then vol1=100
vol2=((vol2N/655.35)+0.5)%1
if vol2<0 then vol2=0
if vol2>100 then vol2=100
if vol1>highvol then highvol=vol1
if vol2>highvol then highvol=vol2
/* ------------- get previous audio levels */
highvolprev=0
vol1prev=((vol1P/655.35)+0.5)%1
if vol1prev<0 then vol1prev=0
if vol1prev>100 then vol1prev=100
vol2prev=((vol2P/655.35)+0.5)%1
if vol2prev<0 then vol2prev=0
if vol2prev>100 then vol2prev=100
if vol1prev>highvolprev then highvolprev=vol1prev
if vol2prev>highvolprev then highvolprev=vol2prev
/* ------------ get volumes & fade speed */
do until fadetime<=(25*60)
f_want=req_time("Fade Time (max 25:00):",f_fadetime)